package com.itheima.annotation;

import com.itheima.Validation.StateValidation;
import jakarta.validation.Constraint;
import jakarta.validation.Payload;

import java.lang.annotation.*;

import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/*  自定义注解校验State  */
@Target(FIELD)
@Retention(RUNTIME)
@Documented
@Constraint(
        validatedBy = {StateValidation.class}
)
public @interface State {
    String message() default "该选项只能为已发布或者草稿！！！";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};

}
